package com.ruoyi.project.system.driverstationinfo.controller;

import java.util.List;

import com.ruoyi.project.system.driverstationinfo.domain.VeDriverstationinfoVo;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.ruoyi.framework.aspectj.lang.annotation.Log;
import com.ruoyi.framework.aspectj.lang.enums.BusinessType;
import com.ruoyi.project.system.driverstationinfo.domain.VeDriverstationinfo;
import com.ruoyi.project.system.driverstationinfo.service.IVeDriverstationinfoService;
import com.ruoyi.framework.web.controller.BaseController;
import com.ruoyi.framework.web.domain.AjaxResult;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.framework.web.page.TableDataInfo;

/**
 * 【请填写功能名称】Controller
 * 
 * @author ruoyi
 * @date 2024-01-06
 */
@Controller
@RequestMapping("/system/driverstationinfo")
public class VeDriverstationinfoController extends BaseController
{
    private String prefix = "system/driverstationinfo";

    @Autowired
    private IVeDriverstationinfoService veDriverstationinfoService;

    @RequiresPermissions("system:driverstationinfo:view")
    @GetMapping()
    public String driverstationinfo()
    {
        return prefix + "/driverstationinfo";
    }

    /**
     * 查询【请填写功能名称】列表
     */
    @RequiresPermissions("system:driverstationinfo:list")
    @PostMapping("/list")
    @ResponseBody
    public TableDataInfo list(VeDriverstationinfoVo veDriverstationinfoVo)
    {
        startPage();
        List<VeDriverstationinfoVo> list = veDriverstationinfoService.selectVeDriverstationinfoList1(veDriverstationinfoVo);
        return getDataTable(list);
    }

    /**
     * 导出【请填写功能名称】列表
     */
    @RequiresPermissions("system:driverstationinfo:export")
    @Log(title = "【请填写功能名称】", businessType = BusinessType.EXPORT)
    @PostMapping("/export")
    @ResponseBody
    public AjaxResult export(VeDriverstationinfo veDriverstationinfo)
    {
        List<VeDriverstationinfo> list = veDriverstationinfoService.selectVeDriverstationinfoList(veDriverstationinfo);
        ExcelUtil<VeDriverstationinfo> util = new ExcelUtil<VeDriverstationinfo>(VeDriverstationinfo.class);
        return util.exportExcel(list, "【请填写功能名称】数据");
    }

    /**
     * 新增【请填写功能名称】
     */
    @GetMapping("/add")
    public String add()
    {
        return prefix + "/add";
    }

    /**
     * 新增保存【请填写功能名称】
     */
    @RequiresPermissions("system:driverstationinfo:add")
    @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
    @PostMapping("/add")
    @ResponseBody
    public AjaxResult addSave(VeDriverstationinfo veDriverstationinfo)
    {
        return toAjax(veDriverstationinfoService.insertVeDriverstationinfo(veDriverstationinfo));
    }

    /**
     * 修改【请填写功能名称】
     */
    @RequiresPermissions("system:driverstationinfo:edit")
    @GetMapping("/edit/{DriverStationID}")
    public String edit(@PathVariable("DriverStationID") Long DriverStationID, ModelMap mmap)
    {
        VeDriverstationinfo veDriverstationinfo = veDriverstationinfoService.selectVeDriverstationinfoByDriverStationID(DriverStationID);
        mmap.put("veDriverstationinfo", veDriverstationinfo);
        return prefix + "/edit";
    }

    /**
     * 修改保存【请填写功能名称】
     */
    @RequiresPermissions("system:driverstationinfo:edit")
    @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
    @PostMapping("/edit")
    @ResponseBody
    public AjaxResult editSave(VeDriverstationinfo veDriverstationinfo)
    {
        return toAjax(veDriverstationinfoService.updateVeDriverstationinfo(veDriverstationinfo));
    }

    /**
     * 删除【请填写功能名称】
     */
    @RequiresPermissions("system:driverstationinfo:remove")
    @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
    @PostMapping( "/remove")
    @ResponseBody
    public AjaxResult remove(String ids)
    {
        return toAjax(veDriverstationinfoService.deleteVeDriverstationinfoByDriverStationIDs(ids));
    }
}
